import * as log4js from 'log4js';
export class MyLogger {
    public logger;
    constructor(isDebug:boolean){
        log4js.configure({
            appenders:{
                "stdout":{"type":"console"},
                "file":{
                    type:'file',
                    filename:'ngterm.log',
                    maxLogSize:1024*512,
                    backups:4
                }
            },
            categories:{
                default:{appenders:['stdout', 'file'],level:'debug'},
                err:{appenders:['stdout', 'file'], level:'error'}
            }
        });
        this.logger = log4js.getLogger();
        if (isDebug) this.logger.level = 'debug';
        else this.logger.level = 'info';
    }
}